package cn.itcast.order.controller;

import cn.itcast.feign.client.ItemClient;
import cn.itcast.feign.client.UserClient;
import cn.itcast.hmall.pojo.item.Item;
import cn.itcast.hmall.pojo.order.Order;
import cn.itcast.hmall.pojo.order.OrderDetail;
import cn.itcast.hmall.pojo.order.OrderLogistics;
import cn.itcast.hmall.pojo.user.Address;
import cn.itcast.hmall.utils.ThreadLocalUtil;
import cn.itcast.order.mapper.OrderMapper;
import cn.itcast.order.service.orderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private UserClient userClient;
    @Autowired
    private ItemClient itemClient;
@Autowired
    private orderService or;
    @PostMapping
    public String order1(@RequestBody Map<String, Long> map) {
        return or.order1(map);
    }

    @GetMapping("{orderId}")
    public Order getOrder(@PathVariable String orderId) {
        Order order = this.orderMapper.selectById(orderId);
        return order;
    }

}
